package com.atguigu.spzx.manager.utils;

import com.atguigu.spzx.model.entity.system.SysUser;

/**
 * @Author：tzl
 * @Date：2024/1/24 10:00
 * @description: 用户ThreadLocal
 */
public class AuthContextUtil {
    private static final ThreadLocal<SysUser> threadLocal = new ThreadLocal<>();

    public static void set(SysUser sysUser) {
        threadLocal.set(sysUser);
    }

    public static SysUser get(){
        return threadLocal.get();
    }

    public static void remove(){
        threadLocal.remove();
    }
}
